# from selenium import webdriver
# from selenium.webdriver.common.by import By
# import time
# import os
# from selenium.webdriver.support.ui import Select
#
#
# class FormOperat:
#     def __init__(self,id,password,tel,email):
#         self.driver=webdriver.Chrome()
#         path=os.path.join(os.path.abspath('html2'),'注册实例.html')
#         self.driver.get(path)
#         self.registerifno={'id':id,'password':password,'tel':tel,'email':email}
#
#     def onergs(self):
#         a=self.driver.find_element(By.ID,'user')
#         a.send_keys(self.registerifno['id'])
#         b = self.driver.find_element(By.ID, 'password')
#         b.send_keys(self.registerifno['password'])
#         c = self.driver.find_element(By.ID, 'tel')
#         c.send_keys(self.registerifno['tel'])
#         d = self.driver.find_element(By.ID, 'email')
#         d.send_keys(self.registerifno['email'])
#         time.sleep(2)
#         self.driver.find_element(By.XPATH,'//*[@title="加入会员"]').click()
#
#     def qiut(self):
#         time.sleep(3)
#         self.driver.quit()
#
#     def ares(self):
#         self.driver.maximize_window()
#         e=self.driver.find_element(By.ID,'idframe1')
#         self.driver.switch_to.frame(e)
#         f = self.driver.find_element(By.ID, 'userA')
#         f.send_keys(self.registerifno['id'])
#         time.sleep(3)
#         g = self.driver.find_element(By.ID, 'passwordA')
#         g.send_keys(self.registerifno['password'])
#         time.sleep(3)
#         h = self.driver.find_element(By.ID, 'telA')
#         h.send_keys(self.registerifno['tel'])
#         time.sleep(3)
#         i = self.driver.find_element(By.ID, 'emailA')
#         i.send_keys(self.registerifno['email'])
#         time.sleep(3)
#         self.driver.find_element(By.XPATH, '//*[@title="加入会员A"]').click()
#         time.sleep(3)
#
#     def bares(self):
#         self.driver.switch_to.default_content()
#         self.driver.maximize_window()
#         j= self.driver.find_element(By.NAME, 'myframe2')
#         self.driver.switch_to.frame(j)
#         k = self.driver.find_element(By.ID, 'userB')
#         k.send_keys(self.registerifno['id'])
#         time.sleep(3)
#         l = self.driver.find_element(By.ID, 'passwordB')
#         l.send_keys(self.registerifno['password'])
#         time.sleep(3)
#         m= self.driver.find_element(By.ID, 'telB')
#         m.send_keys(self.registerifno['tel'])
#         time.sleep(3)
#         n = self.driver.find_element(By.ID, 'emailB')
#         n.send_keys(self.registerifno['email'])
#         time.sleep(3)
#         self.driver.find_element(By.XPATH, '//*[@title="加入会员B"]').click()
#         time.sleep(3)
#
#     def select(self):
#         self.driver.switch_to.parent_frame()
#         s1 =self.driver.find_element(By.ID,'select')
#         select =Select(s1)
#         select.select_by_index(1)
#         time.sleep(2)
#         select.select_by_value('sh')
#         time.sleep(2)
#         select.select_by_visible_text("重庆")
#
#
#
#
#
#
# fo=FormOperat('87878854','123456','110','2507487392@qq.com')
# # fo.onergs()
# # fo.ares()
# fo.select()
# # fo.bares()
# fo.qiut()






# 登录163.com
from selenium import webdriver
from selenium.webdriver.common.by import By
import time

driver = webdriver.Chrome()
driver.get('https://mail.163.com/')
driver.maximize_window()
a=driver.find_element(By.TAG_NAME,'iframe')
driver.switch_to.frame(a)
driver.find_element(By.NAME,"email").send_keys('a2320083160')
driver.find_element(By.NAME,'password').send_keys('dyh730201!')
driver.find_element(By.ID,"dologin").click()

time.sleep(3)
driver.quit()



















